<template>
  <div id="app">
    <div class="box">
       <list :all="all" @chooseAll="chooseAll" @chooseOne="chooseOne"/>
    <foot/>
    </div>
   
  </div>
</template>

<script>
import list from './views/cart-list.vue'
import foot from './views/cart-footer.vue'
import data from '../public/data'
// import Bus from './Bus'
export default {
  components:{list,foot},
  data(){
    return{
      all:data.result.list
    }
  },
  methods:{
    chooseAll(flag){
      this.all.forEach(item=>{
        item.flag = flag
      })
    },
    chooseOne(index){
       this.all[index].flag = !this.all[index].flag
    }
  },
  mounted() {
   
  }
}
</script>

<style>
*{
  margin: 0;
  padding: 0;
}
ul{
  list-style: none;
}
#app,body,html{
  width: 100%;
  height: 100%;
}
.box{
  width: 80%;
  margin: auto;
  border: 3px solid gray;
}
</style>
